package com.javasm.mingming.common.exception;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author javasm
 * @version 0.1
 * @className JavasmExceptionEnum
 * @descriptioin:
 * @date 2024/12/30 14:49
 * @since jdk11
 */
@AllArgsConstructor
@Getter
//默认情况下,json把enum转成json字符串的时候,是"ParameterNull",需要加上注解
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum JavasmExceptionEnum {

    ParameterNull(1001,"参数为空"),
    UserNotExist(1002,"用户不存在"),
    PasswordError(1003,"密码错误"),
    DeleteError(2001,"删除失败"),
    PermissionDenied(600,"权限不足"),
    SessionExpired(601,"Token失效")
    ;

    private Integer code;
    private String msg;

}
